[global __readcr3]
[global __readcr0]
[global __writecr3]
[global __writecr0]
[section .text]

__readcr3:
	mov 	eax, cr3		;le o registro e coloca a variavel de retorno
	ret
__readcr0:
	mov 	eax, cr0		;le o registro de controle 0 e coloca na variavel de retorno
	ret
__writecr3:
	push 	ebp
	mov 	ebp, esp
	mov 	eax,[ebp+8]		;pega o valor passado para o CR3
	mov 	cr3,eax
	pop 	ebp
	ret
__writecr0:
	push 	ebp
	mov 	ebp,esp
	mov 	eax,[ebp+8]		;pega o valor a ser escrito no CR0
	mov 	cr0,eax
	pop	ebp
	ret